﻿//设计模式 - 命令模式
//目的：...不知道有啥目的

var person = new Person();

var command = new WashCommand(person);

command.Execute();




class Person
{
    internal void WashHand()
    {
        Console.WriteLine("洗个手");
    }
}

interface ICommand
{
    void Execute();
}

class WashCommand : ICommand
{
    private readonly Person _person;

    public WashCommand(Person person)
    {
        this._person = person;
    }
    public void Execute()
    {
        _person.WashHand();
    }
}
